package com.haixiaoke.service.impl;

import java.util.List;
import com.haixiaoke.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.haixiaoke.mapper.LockUnlockLogMapper;
import com.haixiaoke.domain.LockUnlockLog;
import com.haixiaoke.service.ILockUnlockLogService;

/**
 * 智能锁开锁记录Service业务层处理
 * 
 * @author qixi
 * @date 2023-05-29
 */
@Service
public class LockUnlockLogServiceImpl implements ILockUnlockLogService {
    @Autowired
    private LockUnlockLogMapper lockUnlockLogMapper;

    /**
     * 查询智能锁开锁记录
     * 
     * @param unlockId 智能锁开锁记录主键
     * @return 智能锁开锁记录
     */
    @Override
    public LockUnlockLog selectLockUnlockLogByUnlockId(Long unlockId) {
        return lockUnlockLogMapper.selectLockUnlockLogByUnlockId(unlockId);
    }

    /**
     * 查询智能锁开锁记录列表
     * 
     * @param lockUnlockLog 智能锁开锁记录
     * @return 智能锁开锁记录
     */
    @Override
    public List<LockUnlockLog> selectLockUnlockLogList(LockUnlockLog lockUnlockLog) {
        return lockUnlockLogMapper.selectLockUnlockLogList(lockUnlockLog);
    }

    /**
     * 新增智能锁开锁记录
     * 
     * @param lockUnlockLog 智能锁开锁记录
     * @return 结果
     */
    @Override
    public int insertLockUnlockLog(LockUnlockLog lockUnlockLog) {
        lockUnlockLog.setCreateTime(DateUtils.getNowDate());
        return lockUnlockLogMapper.insertLockUnlockLog(lockUnlockLog);
    }

    /**
     * 修改智能锁开锁记录
     * 
     * @param lockUnlockLog 智能锁开锁记录
     * @return 结果
     */
    @Override
    public int updateLockUnlockLog(LockUnlockLog lockUnlockLog) {
        return lockUnlockLogMapper.updateLockUnlockLog(lockUnlockLog);
    }

    /**
     * 批量删除智能锁开锁记录
     * 
     * @param unlockIds 需要删除的智能锁开锁记录主键
     * @return 结果
     */
    @Override
    public int deleteLockUnlockLogByUnlockIds(Long[] unlockIds) {
        return lockUnlockLogMapper.deleteLockUnlockLogByUnlockIds(unlockIds);
    }

    /**
     * 删除智能锁开锁记录信息
     * 
     * @param unlockId 智能锁开锁记录主键
     * @return 结果
     */
    @Override
    public int deleteLockUnlockLogByUnlockId(Long unlockId) {
        return lockUnlockLogMapper.deleteLockUnlockLogByUnlockId(unlockId);
    }
}
